package com.frxuexi.mdm2205.view

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import androidx.navigation.NavHostController
import com.frxuexi.mdm2205.R
import com.frxuexi.mdm2205.myview.MyProView

@Composable
fun WelcomePage(navHostController: NavHostController) {
    Box {
        AndroidView(factory = {
            val myProView = MyProView(it, navHostController)
            myProView.start()
            myProView
        })
        Column(Modifier.fillMaxSize(), horizontalAlignment = Alignment.CenterHorizontally) {
            Spacer(modifier = Modifier.height(100.dp))
            Image(painter = painterResource(id = R.drawable.img), contentDescription = "")
            Spacer(modifier = Modifier.height(20.dp))
            Text(text = "MDM")
        }

    }
}